<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/" >
<head>
    <meta charset="UTF-8">
    <title>常用Thymeleaf语法</title>
</head>
<body>
    <a th:href="@{/}">@{/},当前项目的根目录</a><br/>
    <a th:href="@{~/}">@{~/},服务器路径的根</a><br/>
    <a th:href="@{/user(id=1,name='小樊')}">传参</a><br/>
    <span th:text="${msg}"></span><br/>
    消息:<input type="text" th:value="${msg}" name="msg"/><br/>
    截取消息:<input type="text" th:value="${#strings.substring(msg,0,1)}"><br/>
    生日原本格式:<input type="text" name="birthday" th:value="${birthday}"/>
    生日:<input type="text" name="birthday" th:value="${#dates.format(birthday,'yyyy年MM月dd日')}"><br/>
    <span th:if="sex==男">
        性别:男
    </span>
    <span th:if="sex == 女">
        性别:女
    </span>
    <hr/>
    <h1>User List</h1>
    <table border="1px">
        <tr>
            <th>姓名</th>
            <th>生日</th>
            <th>密码</th>
        </tr>
        <tr th:each="user :${userList} ">
            <td th:text="${user.id}"></td>
            <td th:text="${user.birthday}"></td>
            <td th:text="${user.password }"></td>
        </tr>
    </table>
</body>
</html>